package com.jzo2o.customer.client.fallback;

import com.jzo2o.common.model.PageResult;
import com.jzo2o.customer.client.WorkerCertAuditClient;
import com.jzo2o.customer.model.domain.WorkerCertificationAudit;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditPageQueryReqDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class WorkerCertAuditFallback implements FallbackFactory<WorkerCertAuditClient> {
    @Override
    public WorkerCertAuditClient create(Throwable cause) {
        return new WorkerCertAuditClient() {
            @Override
            public PageResult<WorkerCertificationAudit> page(WorkerCertificationAuditPageQueryReqDTO dto) {
                log.error("分页查询实名认证信息 -> {}, 错误 -> {}", dto, cause);
                return new PageResult<>();
            }
        };
    }
}
